package com.azt.api.enums;

import java.util.HashMap;
import java.util.Map;

/**
* @ClassName: CustomerAuditEnum 
* @Description: TODO(审核状态) 
* @author yangcheng 
* @date 2016年4月29日 下午4:01:09 
*
*/
public enum CustomerAuditEnum {
	AUDIT_WAIT(0, "待审核"), AUDIT_WAITAgain(1, "待重新审核"), AUDIT_FAIL(2, "退回修改"), AUDIT_DO(3, "审核通过"), AUDIT_DEL(4, "禁用");

	private int index;
	private String name;

	private CustomerAuditEnum(int index, String name) {
		this.index = index;
		this.name = name;
	}

	/**
	 * @Title: getAllAudit   
	 * @Description: TODO(获得所有审核状态)   
	 * @param: @return      
	 * @return: Map<String,String>      
	 * @throws
	 */
	public static Map<String, String> getAllAudit(){
		Map<String, String>  allaudits = new HashMap<String,String>();
		for (CustomerAuditEnum c : CustomerAuditEnum.values()) {
			allaudits.put(c.getIndex()+"", c.getName());
		}
		return allaudits;
	}
	
	
	public static String getName(Integer index) {
		for (CustomerAuditEnum c : CustomerAuditEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
